import {
	post,
	get
} from '@/common/request.js'

export function getVideo(id) {
	return post("movie/view", {
		movie_id: id
	})
}

export function getVideoList(id) {
	return post("movie/detailList", {
		movie_id: id,
		limit: 100
	})
}

export function searchVideo(data) {
	return post("movie/list", data)
}

export function addCollect(data) {
	return post("collect/on", data)
}

export function removeCollect(data) {
	return post("collect/off", data)
}

export function addLike(data) {
	return post("like/on", data)
}

export function removeLike(data) {
	return post("like/off", data)
}

export function uploadImage(data) {
	return upload("upload", data)
}

export function addComment(data) {
	return post("article/add", data)
}

export function getComment(data, followed) {
	return post(followed ? "article/followList" : "article/list", data)
}

export function myCollect(data) {
	return post("collect/list", data)
}

export function myLike(data) {
	return post("like/list", data)
}

export function historyAdd(data) {
	return post("movie/historyAdd", data)
}

export function historyList(data) {
	return post("movie/historyList", data)
}

export function addDownlaodHistory(vid) {
	return post('download', {
		type: 1,
		vid
	})
}

export function downlaodHistory(data) {
	return post('downloadList', data)
}
export function movieRefer(data) {
	return get('movie/refer', data)
}